﻿<ribbon:RibbonWindow x:Class="DIT.Client.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:ditCoreVM="clr-namespace:DIT.Client.MVVM.ViewModel;assembly=DIT.Client.MVVM"
        xmlns:ditCoreTS="clr-namespace:DIT.Client.MVVM.TemplateSelector;assembly=DIT.Client.MVVM"
        xmlns:ditCoreCnv="clr-namespace:DIT.Client.MVVM.Converter;assembly=DIT.Client.MVVM"
        xmlns:system="clr-namespace:System;assembly=mscorlib"  
        Title="MainWindow"
		x:Name="RibbonWindow"
		WindowState="Maximized" WindowStartupLocation="CenterOwner">
    <Window.DataContext>
        <ditCoreVM:ClientWorkspaceViewModel />
    </Window.DataContext>
    

    <Window.Resources>
        <ObjectDataProvider MethodName="GetAllState" ObjectType="{x:Type ditCoreVM:DataProvider}" x:Key="StateProvider" />
        <ObjectDataProvider MethodName="GetAllGender" ObjectType="{x:Type ditCoreVM:DataProvider}" x:Key="GenderProvider" />
        <ObjectDataProvider MethodName="GetAllEmployerCategory" ObjectType="{x:Type ditCoreVM:DataProvider}" x:Key="EmployerCategoryProvider" />
        <ditCoreCnv:DateStringConverter x:Key="DateStringConverter" />
        <ditCoreCnv:UlongStringConverter x:Key="UlongStringConverter" />
    </Window.Resources>

	<Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style TargetType="{x:Type Border}" x:Key="BorderStyle">
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="BorderBrush" Value="#FF7F9DB9"/>
                <Setter Property="Margin" Value="5"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid.InputBindings>
            <KeyBinding Gesture="Ctrl+S" Command="{Binding Path=SaveCommand}"/>
        </Grid.InputBindings>

        <ribbon:Ribbon x:Name="Ribbon">
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu SmallImageSource="Images\SmallIcon.png">
                    <ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon"
                                                      x:Name="MenuItem1"
                                                      ImageSource="Images\LargeIcon.png"/>
                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>
            <ribbon:RibbonTab Header="Client" KeyTip="C">
                <ribbon:RibbonGroup Header="Save Group">
                    <ribbon:RibbonButton LargeImageSource="Images\SaveIcon.jpg" Label="Save" Command="{Binding SaveCommand}"/>
                    <ribbon:RibbonButton LargeImageSource="Images\NewIcon.jpg" Label="New" Command="{Binding NewCommand}" CommandParameter="true" IsEnabled="{Binding DoesNotContainNewClient}"/>
                    <ribbon:RibbonButton LargeImageSource="Images\DeleteIcon.jpg" Label="Delete" Command="{Binding DeleteCommand}"/>
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup Header="Refresh Group" KeyTip="F">
                    <ribbon:RibbonButton LargeImageSource="Images\RefreshIcon.png" Label="Refresh" Command="{Binding RefreshCommand}"/>
                    <ribbon:RibbonButton LargeImageSource="Images\UndoIcon.png" Label="Undo" Command="{Binding UndoCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab Header="Computation">
                <ribbon:RibbonGroup Header="Save Group">
                    <ribbon:RibbonButton LargeImageSource="Images\LargeIcon.png" Label="Save" />
                    <ribbon:RibbonButton LargeImageSource="Images\LargeIcon.png" Label="Undo" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>

        <Grid Grid.Row="1">
            <Grid.Resources>
                <!--Client List Item Style-->
                <Style x:Key="ListItemStyle" TargetType="{x:Type ListBoxItem}">
                    <Style.Resources>
                        <!--List Item Border Style-->
                        <Style TargetType="Border" x:Key="ListItemBorderStyle" >
                            <Style.Resources>
                                <LinearGradientBrush x:Key="BackBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                                    <GradientStop Color="LightSteelBlue" Offset="0.0" />
                                    <GradientStop Color="SteelBlue" Offset="0.9" />
                                </LinearGradientBrush>
                            </Style.Resources>
                            <Setter Property="Background" Value="{StaticResource BackBrush}"/>
                            <Setter Property="CornerRadius" Value="6"/>
                            <Setter Property="Margin" Value="3"/>
                        </Style>
                        <!-- Background of selected item when focussed -->
                        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                        <!-- Background of selected item when not focussed -->
                        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                    </Style.Resources>
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Border x:Name="ListItemBorder" Style="{StaticResource ListItemBorderStyle}" BorderThickness="1">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Margin="2" FontWeight="Bold" Text="{Binding DisplayName}" MinWidth="200" />
                                        <TextBlock Grid.Row="1" Margin="2" Text="{Binding PAN}" />
                                    </Grid>
                                </Border>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="FontSize" Value="18"/>
                            <Setter Property="Foreground" Value="Gold"/>
                        </Trigger>
                        <DataTrigger Binding="{Binding IsNew}" Value="true">
                            <Setter Property="Foreground" Value="Red"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <!--Client Workspace Template-->
                <DataTemplate x:Key="ClientWorkspaceTemplate">
                    <!--Workspace Panel - Client Workspace-->
                    <Grid x:Name="ClientInfoGrid" DataContext="{Binding ElementName=ClientList, Path=SelectedItem}">
                        <Grid.Resources>

                            <Style TargetType="{x:Type Border}" x:Key="WorkspaceBorderStyle">
                                <Setter Property="BorderThickness" Value="2, 0, 2, 2"/>
                                <Setter Property="BorderBrush" Value="#FF7F9DB9"/>
                                <Setter Property="Margin" Value="32, -1, 10, 10"/>
                            </Style>
                            <Style x:Key="NewClientMessageStyle" TargetType="TextBlock">
                                <Setter Property="Text" Value="It is New Client. Modify default values and Click Save to create it."/>
                                <Setter Property="Foreground" Value="Red"/>
                                <Setter Property="FontSize" Value="15"/>
                                <Setter Property="FontWeight" Value="Bold"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ElementName=ClientInfoGrid, Path=DataContext}" Value="{x:Null}">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsNew}" Value="false">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>

                            <Style TargetType="{x:Type TextBlock}" x:Key="TextBlockStyleForWorkspace">
                                <Setter Property="TextWrapping" Value="Wrap"/>
                                <Setter Property="MinWidth" Value="50"/>
                                <Setter Property="MaxWidth" Value="200"/>
                                <Setter Property="Margin" Value="5, 10, 5, 10"/>
                                <Setter Property="VerticalAlignment" Value="Center"/>
                                <Setter Property="FontFamily" Value="Calibri"/>
                                <Setter Property="FontSize" Value="13"/>
                            </Style>
                            <Style TargetType="{x:Type TextBox}" x:Key="TextBoxStyleForWorkspace">
                                <Setter Property="MinWidth" Value="100"/>
                                <Setter Property="MaxWidth" Value="200"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="Margin" Value="5, 10, 10, 10"/>
                                <Setter Property="FontFamily" Value="Calibri"/>
                                <Setter Property="FontSize" Value="14"/>
                                <Style.Triggers>
                                    <Trigger Property="Validation.HasError" Value="true">
                                        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                            <Style TargetType="{x:Type ComboBox}" x:Key="ComboBoxStyleForWorkspace">
                                <Setter Property="MinWidth" Value="50"/>
                                <Setter Property="MaxWidth" Value="200"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="Margin" Value="5, 10, 10, 10"/>
                            </Style>

                            <Style TargetType="Border" x:Key="ExpanderHeaderBorderStyle" >
                                <Style.Resources>
                                    <LinearGradientBrush x:Key="BackBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Color="SteelBlue" Offset="0.3" />
                                        <GradientStop Color="#FF7F9DB9" Offset="0.9" />
                                    </LinearGradientBrush>
                                </Style.Resources>
                                <Setter Property="Background" Value="{StaticResource BackBrush}"/>
                                <Setter Property="CornerRadius" Value="4"/>
                            </Style>
                            <DataTemplate x:Key="ExpanderHeaderTemplate">
                                <Border Style="{StaticResource ExpanderHeaderBorderStyle}" Height="24">
                                    <StackPanel>
                                        <TextBlock Text="{Binding}" Margin="4 0" VerticalAlignment="Center" Foreground="White"
                                               FontSize="11" FontWeight="Normal" 
                                               Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}, Path=ActualWidth}"
                                               TextWrapping="Wrap"/>
                                    </StackPanel>
                                </Border>
                            </DataTemplate>
                            <Style TargetType="{x:Type Expander}">
                                <Setter Property="HeaderTemplate" Value="{StaticResource ExpanderHeaderTemplate}"/>
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsNew}">
                                        
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>

                            <!--Firm Client Template-->
                            <DataTemplate x:Key="FirmInfoTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <TextBlock Text="Firm Info"/>
                                </Border>
                            </DataTemplate>
                            <!--HUF Client Template-->
                            <DataTemplate x:Key="HUFInfoTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>

                                        <!--First Row-->
                                        <!--First Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="First Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding FirstName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Middle Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="Middle Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding MiddleName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Last Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="4" Text="Last Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="5" Text="{Binding SurNameOrOrgName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Second Row-->
                                        <!--Flat/Door/Block No-->
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Flat/Door/Block No :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ResidenceNo, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Name of Premises/Building/Village-->
                                        <TextBlock Grid.Row="1" Grid.Column="2" Text="Name of Premises/Building/Village :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="1" Grid.Column="3" Text="{Binding ResidenceName, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Third Row-->
                                        <!--Road/Street/Post Office-->
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Road/Street/Post Office :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RoadOrStreet, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Name of Area/Locality-->
                                        <TextBlock Grid.Row="2" Grid.Column="2" Text="Area/Locality :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding LocalityOrArea, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Date of Birth(DD/MM/YYYY)-->
                                        <TextBlock Grid.Row="2" Grid.Column="4" Style="{StaticResource TextBlockStyleForWorkspace}" Text="Date of Birth"/>
                                        <TextBox Grid.Row="2" Grid.Column="5" Text="{Binding DOB, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource DateStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Fourth Row-->
                                        <!--Town/City/District-->
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Town/City/District :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding CityOrTownOrDistrict, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--State-->
                                        <TextBlock Grid.Row="3" Grid.Column="2" Text="State :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <ComboBox Grid.Row="3" Grid.Column="3" ItemsSource="{Binding Source={StaticResource StateProvider}}"
                          SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding StateCode, Mode=TwoWay}" Style="{StaticResource ComboBoxStyleForWorkspace}" />
                                        <!--Pin Code-->
                                        <TextBlock Grid.Row="3" Grid.Column="4" Text="Pin Code :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="3" Grid.Column="5" Text="{Binding PinCode, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Fifth Row-->
                                        <!--Residential/Office Phone Number with STD code-->
                                        <TextBlock Grid.Row="4" Grid.Column="0" Text="Residential/Office Phone Number with STD code :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                                            <TextBox MinWidth="50" Margin="5, 5, 2, 5" Text="{Binding STD, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                            <TextBox Margin="2, 5, 5, 5" Text="{Binding PhoneNo, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        </StackPanel>
                                        <!--Mobile No-->
                                        <TextBlock Grid.Row="4" Grid.Column="2" Text="Mobile No :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding MobileNo, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Sixth Row-->
                                        <!--Email Address-->
                                        <TextBlock Grid.Row="5" Grid.Column="0" Text="Email Address :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding EmailAddress, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                    </Grid>
                                </Border>
                            </DataTemplate>
                            <!--Individual Client Template-->
                            <DataTemplate x:Key="IndividualInfoTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>

                                        <!--First Row-->
                                        <!--First Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="First Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding FirstName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Middle Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="Middle Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="3" Text="{Binding MiddleName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Last Name-->
                                        <TextBlock Grid.Row="0" Grid.Column="4" Text="Last Name :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="0" Grid.Column="5" Text="{Binding SurNameOrOrgName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Second Row-->
                                        <!--Flat/Door/Block No-->
                                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Flat/Door/Block No :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ResidenceNo, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Name of Premises/Building/Village-->
                                        <TextBlock Grid.Row="1" Grid.Column="2" Text="Name of Premises/Building/Village :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="1" Grid.Column="3" Text="{Binding ResidenceName, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Third Row-->
                                        <!--Road/Street/Post Office-->
                                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Road/Street/Post Office :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RoadOrStreet, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Name of Area/Locality-->
                                        <TextBlock Grid.Row="2" Grid.Column="2" Text="Area/Locality :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="2" Grid.Column="3" Text="{Binding LocalityOrArea, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Date of Birth(DD/MM/YYYY)-->
                                        <TextBlock Grid.Row="2" Grid.Column="4" Style="{StaticResource TextBlockStyleForWorkspace}" Text="Date of Birth"/>
                                        <TextBox Grid.Row="2" Grid.Column="5" Text="{Binding DOB, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource DateStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />

                                        <!--Fourth Row-->
                                        <!--Town/City/District-->
                                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Town/City/District :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding CityOrTownOrDistrict, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--State-->
                                        <TextBlock Grid.Row="3" Grid.Column="2" Text="State :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <ComboBox Grid.Row="3" Grid.Column="3" ItemsSource="{Binding Source={StaticResource StateProvider}}"
                          SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding StateCode, Mode=TwoWay}" Style="{StaticResource ComboBoxStyleForWorkspace}" />
                                        <!--Pin Code-->
                                        <TextBlock Grid.Row="3" Grid.Column="4" Text="Pin Code :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="3" Grid.Column="5" Text="{Binding PinCode, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Sex-->
                                        <TextBlock Grid.Row="3" Grid.Column="6" Text="Sex :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <ComboBox Grid.Row="3" Grid.Column="7" ItemsSource="{Binding Source={StaticResource GenderProvider}}"
                          SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding Gender, Mode=TwoWay}" Style="{StaticResource ComboBoxStyleForWorkspace}" />

                                        <!--Fifth Row-->
                                        <!--Residential/Office Phone Number with STD code-->
                                        <TextBlock Grid.Row="4" Grid.Column="0" Text="Residential/Office Phone Number with STD code :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                                            <TextBox MinWidth="50" Margin="5, 5, 2, 5" Text="{Binding STD, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                            <TextBox Margin="2, 5, 5, 5" Text="{Binding PhoneNo, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        </StackPanel>
                                        <!--Mobile No-->
                                        <TextBlock Grid.Row="4" Grid.Column="2" Text="Mobile No :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="4" Grid.Column="3" Text="{Binding MobileNo, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UlongStringConverter}, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                        <!--Employer Category(if in employment)-->
                                        <TextBlock Grid.Row="4" Grid.Column="4" Text="Employer Category(if in employment) :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <ComboBox Grid.Row="4" Grid.Column="5" ItemsSource="{Binding Source={StaticResource EmployerCategoryProvider}}"
                          SelectedValuePath="Key" DisplayMemberPath="Value" SelectedValue="{Binding EmployerCategory, Mode=TwoWay}" Style="{StaticResource ComboBoxStyleForWorkspace}" />

                                        <!--Sixth Row-->
                                        <!--Email Address-->
                                        <TextBlock Grid.Row="5" Grid.Column="0" Text="Email Address :" Style="{StaticResource TextBlockStyleForWorkspace}" />
                                        <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding EmailAddress, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" Style="{StaticResource TextBoxStyleForWorkspace}" />
                                    </Grid>
                                </Border>
                            </DataTemplate>
                            <!--Client Type Template Selector-->
                            <ditCoreTS:PersonalInfoTemplateSelector x:Key="PersonalInfoTemplateSelector"
                                              FirmInfoTemplate="{StaticResource FirmInfoTemplate}"
                                              HUFInfoTemplate="{StaticResource HUFInfoTemplate}"
                                              IndividualInfoTemplate="{StaticResource IndividualInfoTemplate}" />

                            <!--Firm Computation Template-->
                            <DataTemplate x:Key="FirmComputationTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <TextBlock Text="Firm Computation"/>
                                </Border>
                            </DataTemplate>
                            <!--HUF Computation Template-->
                            <DataTemplate x:Key="HUFComputationTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <TextBlock Text="HUF Computation"/>
                                </Border>
                            </DataTemplate>
                            <!--Individual Computation Template-->
                            <DataTemplate x:Key="IndividualComputationTemplate">
                                <Border Style="{StaticResource WorkspaceBorderStyle}">
                                    <TextBlock Text="Individual Computation"/>
                                </Border>
                            </DataTemplate>
                            <!--Client Type Template Selector-->
                            <ditCoreTS:ComputationTemplateSelector x:Key="ComputationTemplateSelector"
                                              FirmComputationTemplate="{StaticResource FirmComputationTemplate}"
                                              HUFComputationTemplate="{StaticResource HUFComputationTemplate}"
                                              IndividualComputationTemplate="{StaticResource IndividualComputationTemplate}" />
                        </Grid.Resources>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Margin="5" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Center" Style="{StaticResource NewClientMessageStyle}"/>
                        <TextBlock Margin="30, 5, 5, 5" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Text="{Binding DisplayName}" FontSize="18" FontWeight="Bold"/>
                        <TextBox Margin="5, 5, 8, 5" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding PAN, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" FontSize="16" FontWeight="Bold" />
                        <StackPanel Grid.Row="2" Grid.ColumnSpan="2">
                            <Expander IsExpanded="True" Header="Personal Information" ExpandDirection="Down" Content="{Binding ElementName=ClientInfoGrid, Path=DataContext}" ContentTemplateSelector="{StaticResource PersonalInfoTemplateSelector}"/>
                            <Expander Header="Filling Status" ExpandDirection="Down" Content="{Binding ElementName=ClientInfoGrid, Path=DataContext}" ContentTemplateSelector="{StaticResource ComputationTemplateSelector}"/>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <!--Navigation Panel - Client List-->
            <Border Grid.Column="0" Margin="0"  Style="{StaticResource BorderStyle}" >
                <DockPanel>
                    <ribbon:RibbonTextBox Label="Search Client:" DockPanel.Dock="Top" Margin="0, 5, 0, 5" Text="{Binding Path=FilterText, UpdateSourceTrigger=PropertyChanged}" />
                    <ListBox DockPanel.Dock="Top" x:Name="ClientList" HorizontalContentAlignment="Stretch"
                         ItemsSource="{Binding ClientCollection}"
                         ItemContainerStyle="{StaticResource ListItemStyle}"
                         SelectedItem="{Binding SelectedClient}"                             
                         SelectionMode="Extended"/>
                </DockPanel>
            </Border>
            <!--Workspace Panel -->
            <Border Grid.Column="1" Margin="0"  Style="{StaticResource BorderStyle}" >
                <ContentControl Content="{Binding ClientList, Path=SelectedItem}" ContentTemplate="{StaticResource ClientWorkspaceTemplate}" />
            </Border>
        </Grid>

        <Border Margin="0" Grid.Row="2" Style="{StaticResource BorderStyle}">
            <StatusBar Padding="5">
                <TextBlock Text="{Binding InfoMessage}" />
                <Separator/>
                <TextBlock Text="{Binding ActionMessage}"/>
            </StatusBar>
        </Border>
        
        <Popup></Popup>
    </Grid>
</ribbon:RibbonWindow>